package com.wl2o2o.basic;

/**
 * 抽象类中不一定需要含有抽象方法，但是如果一个类中含有抽象方法，那么这个类一定是抽象类
 * 抽象类和普通类最大的区别就是，抽象类不能被实例化，只能被继承
 * @Author <a href="https://github.com/wl2o2o">程序员CSGUIDER</a>
 * @From <a href="https://wl2o2o.github.io">CSGUIDER博客</a>
 * @CreateTime 2024/6/7
 */

public abstract class AbstractExample {
    private String name;
    private int age;

    public AbstractExample(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "AbstractExample{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public abstract void func1();

    public void func2() {
        System.out.println("func2");
    }

}
